package ch8.zadanie2;

import java.util.Date;

public class Car {
	private String marka;
	private Date data;

	Car(String marka, Date data) {
		setMarka(marka);
		setData(data);
	}

	public String getMarka() {
		return this.marka;
	}

	public void setMarka(String marka) {
		this.marka = marka;
	}

	public Date getData() {
		return this.data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	protected Long getCarAge(Car car) {
		Date today = new Date();
		Long seconds = today.getTime() - getData().getTime();
		Long years = (seconds / (1000 * 60 * 60 * 24)) / 365;
		return years;
	}
}